import Vue from "vue";
import Router from "vue-router";
import Infor from "../pages/InFor";
import Home from "../components/Home";

Vue.use(Router);

export default new Router({
  routes: [
    {
      path: "/",
      name: "Login",
      component: () => import("../pages/Login.vue"),
    },
    {
      path: "/register",
      component: () => import("../pages/Register.vue"),
    },
    {
      path: "/404",
      name: "404",
      component: () => import("../pages/404.vue"),
    },
    {
      path: "/home",
      name: "Home",
      component: () => import("../components/Home"),
      meta: {
        requireAuth: true
      },
      children: [
        {
          path: "/inFor",
          name: "InFor",
          component: () => import("../pages/InFor"),

        },
        {
          path: "/consumer",
          name: "Consumer",
          component: () => import("../pages/Consumer"),
        },
        {
          path: "/consumerStaff",
          name: "ConsumerStaff",
          component: () => import("../pages/ConsumerStaff"),
        },
        {
          path: "/staffList",
          name: "staffList",
          component: () => import("../pages/StaffList"),
        },
        {
          path: "/staff",
          name: "staff",
          component: () => import("../pages/Staff"),
        },
        {
          path: "/collect",
          name: "collect",
          component: () => import("../pages/Collect"),
        },
        {
          path: "/comment",
          name: "comment",
          component: () => import("../pages/Comment"),
        },
        {
          path: "/approval",
          name: "approval",
          component: () => import("../pages/Approval"),
        },
      ],
    },
  ],
});


